package com.eonmind.ai.config;

import com.alibaba.cloud.ai.dashscope.api.DashScopeApi;
import lombok.Data;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Xujie
 * @since 2025/6/1 20:28
 **/
@Slf4j
@Configuration
@Data
@ToString
public class AiConfig {
    @Value("${ai.max-draw-task-count:1}")
    private Integer maxDrawTaskCount;

    @Value("${ai.max-draw-task-expire:30}")
    private Integer maxDrawTaskExpire;


    @Value("${spring.ai.dashscope.api-key}")
    private String apiKey;

    @Bean
    public DashScopeApi dashScopeApi() {
        return new DashScopeApi(apiKey);
    }
}
